import axios from '../axios'
import { ADMIN_GRADE } from '../../CONST'

export default {
    /**
     @param 无参
     * 获取年级列表
     */
    getGradeListApi() {
        console.log('触发');
        return axios({
            url: ADMIN_GRADE + '/list',
            method: 'get',
        })
    },
    /**
    @param 无参 {
           "courseNum": 0,
            "id": 0,
           "name": "成人大学"
       }
    * 新增年级
    */
    addGradeApi(params) {
        return axios({
            url: ADMIN_GRADE + '/add',
            method: 'post',
            body: params
        })
    },

    /**
    @param 班级id
    * 查看年级
    */
    checkGradeApi(params) {
        return axios({
            url: ADMIN_GRADE + '/get',
            method: 'get',
            query: params
        })
    },

    /**
    @param 
    * 修改年级  班级id 要修改的名称 name
    {
        "courseNum": 0,
        "id": 18,
        "name": "大四"
        }    
    */
    modifyGradeApi(params) {
        return axios({
            url: ADMIN_GRADE + '/get',
            method: 'get',
            body: params
        })
    }
}